import { defineConfig } from 'vitest/config'
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  plugins: [vue()],
  test: {
    environment: 'jsdom',
    globals: true,
    mockReset: true,
    clearMocks: true,
    restoreMocks: true
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    },
    dedupe: ['@kitware/vtk.js', 'gl-matrix']
  },
  optimizeDeps: {
    include: ['js-3d-model'],
    exclude: ['@kitware/vtk.js']
  },
  define: {
    global: 'globalThis'
  }
})
